<template>
  <!-- 面包屑 -->
  <div class="breadcumb">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item v-for="v in list" :key="v.path"
        ><router-link :to="v.path">{{
          v.meta.title
        }}</router-link></el-breadcrumb-item
      >
    </el-breadcrumb>
  </div>
</template>

<script>
export default {
  name: "BreadCumb",
  data() {
    return {
      list: [],
    };
  },
  created() {
    console.log(this.$route.matched);
    this.list = this.$route.matched;
  },
  watch: {
    // 路由监听
    $route() {
      this.list = this.$route.matched;
    },
  },
  methods: {},
};
</script>

<style  lang="less" scoped>
</style>
